package com.shu.project.model;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

import java.io.Serializable;
import java.lang.reflect.Field;

public class BaseEntity implements Serializable {
    private static final long serialVersionUID = -4593930412422763016L;

    /**
     * 打印
     * @return
     */
    public String toString() {
        return (new ReflectionToStringBuilder(this) /*{
            // 注意这里为了表达上的简洁用了匿名内部类.,不打印密码
            protected boolean accept(Field f) {
                return super.accept(f) && !f.getName().equals("password");
            }
        }*/).toString();
    }
}
